
public class MyTree {
  
  class MyNode {
    public MyNode left;
    public MyNode right;
    public int value;
  }
  
  MyNode root;

  public boolean search(int value) {
    return searchR(root, value);
  }
  
  private boolean searchR(MyNode node, int value) {

    if (node.value == value)
      return true;

    if (value < node.value)
      return searchR(node.left, value);

    if (value > node.value)
      return searchR(node.left, value);
    
    throw new RuntimeException("We should not be here");
  }
}
